<%--
 *  File:    DataCleanDetail.jsp
 *  @Author: Jamesli
 *  Date:    2010/7/22
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<%//init param
	String privilegeCode = "E0211";
	String strModuleName = "CM";
	String contextPath = request.getContextPath();
%>

<%//--------------------------------------  include files list --%>

<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>


<html>
<head>
<title>DataCleanDetail</title>
<PageFlow:CheckPageFlow pageName="p_originaldatasummary"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc"%>

<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "DataCleanDetail.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function page_back(){
	var processtype = cform.processtype.value;
	if(processtype == '' || processtype == -1){
		processtype = 10;
	}
	self.location.href='<%=contextPath %>/phap/phap.datp/masterdata/cm/dataclean/DataClean.jsp?<%= OvalTools.randomURL() %>&processtype=' + processtype  + '&datafrequency=' + cform.datafrequency.value;
}

function page_changecleanrule(){
	if(cform.cleanrule.value == ""){
		cform.errorlevelshow.options[0].selected = true;
		cform.errorlevelshow.disabled = true;
	}else{
		cform.errorlevelshow.disabled = false;
	}
}

function page_onload(){
	if(cform.cleanrule.value != "") cform.errorlevelshow.disabled = false;
}
</script>
</head>

<body onload="page_onload()">
<iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher" target="_parent">
	<input type="hidden" name="pagename" value="p_originaldatasummary"> 
	<input type="hidden" name="actionname"> 
	<custom:hidden property="datafileid"/>
	<custom:hidden property="processtype"/>
	<custom:hidden property="datafrequency"/>
<%@ include file="/inc/PageLocation.inc" %>
<%
	Integer processtype = (Integer)pageContext.getAttribute("processtype");
%>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
	<tr>
		<td class="summary_top"></td>
	</tr>
	<tr>
	    <td> 
	      <table width="100%" border="0" cellspacing="0">  
	         <tr>
	         	<td class="td_right" ><%= label.getLabelName("L_CleanType") + label.getLabelName("L_Colon") %></td>
	         	<td><%
         			String rulestr = (String)pageContext.getAttribute("cleanrulestr");
         			if(rulestr == null) rulestr = "";
         			%>
         			<custom:selectdic dictType="DataCleanRule" valueCriteria="<%=rulestr %>" property="cleanrule" defaultValue="---------" defaultValueCost="" onchange="page_changecleanrule()"/>
	         	</td>
	         	<td class="td_right" ><%= label.getLabelName("L_ErrorLevel") + label.getLabelName("L_Colon") %></td>
	         	<td>
	         		<custom:selectdic dictType="ErrorLevel" property="errorlevel" changedName="errorlevelshow" defaultValue="--------" defaultValueCost="" onchange="javascript:cform.errorlevel.value = cform.errorlevelshow.value;" disabled="true"/>
	         		<a href="javascript:page_summary('search')"><img src="<%= contextPath %>/images/<%= strLanguageCode %>/go_fy.gif" border="0" style="border: 1 solid #000000"></a>
	         		<custom:hidden property="errorlevel"/>
	         	</td>
	         </tr>
	       </table>
	    </td>
	</tr>
	<tr>
		<td>
		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
		<tr class="deepblue-left"> 
          <td width="20%" class="title_center"><%= label.getLabelName("L_Dealer") %></td>
          <%if(processtype.intValue() != 20){ %>
          <td width="*%" class="title_center"><%if((processtype.intValue() == 10)||(processtype.intValue() == 70)){%><%= label.getLabelName("L_Customer") %><%}else{ %><%= label.getLabelName("L_Vendor") %><%} %></td>
          <td width="8%" class="title_center"><%if((processtype.intValue() == 10)||(processtype.intValue() == 70)){%><%= label.getLabelName("L_ComBuyer") + label.getLabelName("L_Province")%><%}else{ %><%=label.getLabelName("L_Vendor") + label.getLabelName("L_Province")%><%} %></td>
          <td width="8%" class="title_center"><%if((processtype.intValue() == 10)||(processtype.intValue() == 70)){%><%= label.getLabelName("L_ComBuyer") + label.getLabelName("L_City")%><%}else{ %><%=label.getLabelName("L_Vendor") + label.getLabelName("L_City")%><%} %></td>
          <td width="8%" class="title_center"><%if((processtype.intValue() == 10)||(processtype.intValue() == 70)){%><%= label.getLabelName("L_ComBuyer") + label.getLabelName("L_County")%><%}else{ %><%=label.getLabelName("L_Vendor") + label.getLabelName("L_County")%><%} %></td>
          <% }%>
          <td width="6%" class="title_center"><%= label.getLabelName("L_Prodcode1")%></td>
          <td width="15%" class="title_center"><%= label.getLabelName("L_ProdName")%></td>
          <td width="5%" class="title_center"><%= label.getLabelName("L_Quantity")%></td>
          <td width="5%" class="title_center"><%= label.getLabelName("L_Spec")%></td>
          <td width="8%" class="title_center"><%if(processtype.intValue() == 10){%><%=label.getLabelName("L_SalesDate") %><%}else if(processtype.intValue() == 20){%><%=label.getLabelName("L_InvDate") %><%}else{%><%=label.getLabelName("L_PurchaseDate") %><%}%></td>
          <!--<td width="8%" class="title_center"><%= label.getLabelName("L_AddOns")+label.getLabelName("L_Time")%></td>  -->
        </tr>
        
        <%
	        int i = 0;
	        String strClassType = new String();   

        	Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
        	if(totalsummary == null) totalsummary = new Vector();
        %>
        <logic:iterate id="summary" collection="<%= totalsummary %>">                      
        <% 
	        if(i%2 == 1)
	          	strClassType = "td-listrom";
	        else                    
	          	strClassType = "none";
	        i++;     
         %>           
        <tr class="<%= strClassType %>" onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%= strClassType %>'" >
            <td>&nbsp;<custom:write property="dtname" name="summary" nbsp="true"/></td>
            <%if(processtype.intValue() != 20){ %>
            <td>&nbsp;<custom:write property="partnername" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="regionname" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="cityname" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="countyname" name="summary" nbsp="true"/></td>
            <% }%>
            <td>&nbsp;<custom:write property="prodcode" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="prodname" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="qty" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="spec" name="summary" nbsp="true"/></td>
            <td>&nbsp;<custom:write property="thedate" dataType="date" dataFormat="yyyy-MM-dd" name="summary" nbsp="true"/></td>
            <!--  <td>&nbsp;<custom:write property="supplydate" dataType="date" dataFormat="yyyy-MM-dd" name="summary" nbsp="true"/></td>-->
        </tr>
        </logic:iterate>  
     <%@ include file="/inc/SummaryAction.inc" %>
		</table>
		<%//--------------------------------------  page operation button --%>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				<td class="td_center">
					<a onclick="page_back()"><custom:button type="1" label="L_Back" imgsrc="finish.gif" border="0" style="width:60" /></a>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</form>
</body>
</html>



